package com.da.springboot.mapper;

import com.da.springboot.bean.Department;
import org.apache.ibatis.annotations.*;

//@Mapper
public interface DepartmentMapper {

    @Select("select * from sb_department where id=#{id}")
    public Department getDeptById(Integer id);

    @Delete("delete from sb_department where id=#{id}")
    public int deleteDeptById(Integer id);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into sb_department(departmentName) values(#{departmentName})")
    public int addDept(Department department);

    @Update("update sb_department set departmentName=#{departmentName} where id=#{id}")
    public int updateDept(Department department);
}

